<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/30 0030
 * Time: 下午 4:01
 */
namespace app\api\controller;

use app\common\service\Upload as UploadFile;

use think\Controller;

class Upload extends Controller
{

    public function upload(){
        $upload = new UploadFile();
        return $upload->upload();
    }

    public function layuiUpload(){
        $upload = new UploadFile();
        return $upload->layuiUpload();
    }

    public function uploadstream($data){
        $upload = new UploadFile();
        return $upload->uploadstream($data);
    }

    public function delete(){
        $param = $this->request->param();
        if (empty($param['imgUrl'])) {
            return show(config('status.ERROR_STATUS'), '参数错误', 'imgUrl 不能为空');
        }

        $upload = new UploadFile();
        return $upload->delete($param['imgUrl']);
    }
}